package cuishifeng.blog.learn.camel;

import org.apache.camel.ProducerTemplate;

/**
 * @author cuishifeng <cuishifeng0207@163.com>
 * Created on 2021-04-12
 */
public class ApiService {


    public ResponseBody requestSelf(RequestBody requestBody) {
        ProducerTemplate producerTemplate = CamelTestDemo.producerTemplate;
        ResponseBody responseBody = producerTemplate
                .requestBodyAndHeader("direct:ok", requestBody, "notify", User.class, ResponseBody.class);
        return responseBody;
    }


    public ResponseBody requestOther(RequestBody requestBody) {
        ProducerTemplate producerTemplate = CamelTestDemo.producerTemplate;
        ResponseBody responseBody = producerTemplate
                .requestBodyAndHeader("direct:ok", requestBody, "notify", "spuChange", ResponseBody.class);
        return responseBody;
    }
}
